<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    {strip}
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="{$design}style/main.css" rel="stylesheet" type="text/css">
        <link href="{$design}style/papers.css" rel="stylesheet" type="text/css">
        <link href="{$design}style/center_content.css" rel="stylesheet" type="text/css">
        <script type="text/javascript" src="{$design}js/main.js"></script>
        <title>Вебсайт Романчика Валерия Станиславовича</title>
    </head>
    <body>
        {include file="globals/head.html"}
        <div class="mainCenter" align="center">
            <div class="mainCenterContent">
                <div class="mainCenterContentLeft">
                    <div class="leftContentBgTop">
                    </div>
                    <div class="leftContentBgCenter" align="center">
                        <div class="postList">
                            {if $news|@count}
                            {foreach from=$news item=newsItem}
                            <div class="postListItem">
                                <div class="postListItemPostedTime" align="left">
                                    <div class="postedTimeBgLeft">
                                    </div>
                                    <div class="postedTimeBgCenter">
                                        {$newsItem.postdate} , {$newsItem.author}
                                    </div>
                                    <div class="postedTimeBgRight">
                                    </div>
                                </div>
                                <span style="clear: left"></span>
                                <div class="postListItemHeader">
                                    <h2> <a href="/new{$newsItem.newid}.html">  {$newsItem.caption}  </a> </h2>
                                </div>
                                <div class="postListItemRedLine">
                                </div>
                                <div class="postListItemContent" align="left">
                                    {assign var="previewImgWidth" value=156}
                                    {assign var="previewImgHeight" value=156}
                                    {if $newsItem.image.width>$newsItem.image.height}
                                    {if $newsItem.image.width>$previewImgWidth}
                                    {assign var="newWidth" value=$previewImgWidth}
                                    {assign var="newHeight" value=`$newsItem.image.height/$newsItem.image.width*$previewImgHeight`}
                                    {else}
                                    {assign var="newWidth" value=$newsItem.image.width}
                                    {assign var="newHeight" value=$newsItem.image].height}
                                    {/if}
                                    {else}
                                    {if $newsItem.image.height>$previewImgHeight}
                                    {assign var="newHeight" value=$previewImgHeight}
                                    {assign var="newWidth" value=`$newsItem.image.width/$newsItem.image.height*$previewImgWidth`}
                                    {else}
                                    {assign var="newWidth" value=$newsItem.image.width}
                                    {assign var="newHeight" value=$newsItem.image.height}
                                    {/if}
                                    {/if}
                                    <img src="{$newsItem.image.url}" alt=""  width={$newWidth} height={$newHeight}/>
                                    <p>
                                        {$newsItem.maintext}
                                    </p>
                                </div>
                                <div class="postListItemActions">
                                    <p> <a href="/new{$newsItem.newid}.html" class="postListItemDetails"> Read more >> </a> | <span class="postListItemComments"> Comments({$newsItem.countComments}) </span> </p>
                                </div>
                            </div>
                            {/foreach}
                            {else}
                            <div style="display: block; text-align: center;">
                                <h2> There are no posted news. Maybe your will be first. </h2>
                            </div>
                            {/if}

                        </div>
                    </div>
                    <div class="leftContentBgBottom">
                    </div>
                    <div class="pageListContainer" align="center">
                        <div class="pageList" align="center">
                            <div class="pageListBgLeft">
                                {if $smarty.get.pagenum != 1}
                                <a href="/search/{$query}/{$smarty.get.pagenum-1}.html"> << </a>
                                {/if}
                            </div>

                            <div class="pageListBgCenter">
                                {if isset($leftIndexes)}
                                    {foreach from=$leftIndexes item=curIndex}
                                        {if $smarty.get.pagenum == $curIndex}
                                            <span style="font-weight: bold">&nbsp; {$curIndex} &nbsp; </span>
                                        {else}
                                            &nbsp; <a href="/search/{$query}/{$curIndex}.html"> {$curIndex} </a> &nbsp;
                                        {/if}
                                    {/foreach}
                                    {if isset($centerIndexes)}
                                    ...
                                    {/if}
                                {/if}
                                {if isset($centerIndexes)}
                                    {foreach item=curIndex from=$centerIndexes}
                                        {if $smarty.get.pagenum == $curIndex}
                                            <span style="font-weight: bold">&nbsp; {$curIndex} &nbsp; </span>
                                        {else}
                                            &nbsp;<a href="/search/{$query}/{$curIndex}.html"> {$curIndex} </a> &nbsp;
                                        {/if}
                                    {/foreach}
                                {else}
                                    ...
                                {/if}
                                {if isset($rightIndexes)}
                                    {if isset($centerIndexes)}
                                    ...
                                    {/if}
                                    {foreach from=$rightIndexes item=curIndex}
                                        {if $smarty.get.pagenum == $curIndex}
                                            <span style="font-weight: bold">&nbsp; {$curIndex} &nbsp; </span>
                                        {else}
                                            &nbsp; <a href="/search/{$query}/{$curIndex}.html"> {$curIndex} </a>  &nbsp;
                                        {/if}
                                    {/foreach}
                                {/if}
                            </div>
                            
                            <div class="pageListBgRight">
                                {if $smarty.get.pagenum != $countPages}
                                    <a href="/search/{$query}/{$smarty.get.pagenum+1}.html"> >> </a>
                                {/if}
                            </div>
                            <span style="clear: both"></span>
                        </div>
                    </div>
                </div>
                {include file="globals/right.html"}
            </div>
        </div>
        {include file="globals/footer.html"}
    </body>
    {/strip}
</html>
